//
//  DatabaseManager.h
//  Voxper
//
//  Created by Erphan on 2/10/11.
//  Copyright 2011 Smonte. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <sqlite3.h>

@class Country;
@class PhoneContact;
@class RecentCallItem;

@interface DatabaseManager : NSObject {
	sqlite3 *database;
}

- (BOOL)getCountriesList:(NSMutableArray *)arrayList;
- (BOOL)getCountry:(Country *)country :(NSString *)condition;

- (BOOL)getContacts:(NSMutableArray *)arrayList bVoxperOnly:(BOOL)bVoxperOnly;
- (BOOL)addContact:(PhoneContact *)contact;
- (BOOL)addSipPhoneNumbers:(NSString *)strLocalId strPhoneNumber:(NSString *)strPhoneNumber strSipNumber:(NSString *)strSipNumber;
- (BOOL)clearSipPhoneNumbers;
- (BOOL)getSipContacts:(NSString *)strLocalId destinationArray:(NSMutableArray *)destinationArray;

- (BOOL)getConversations:(NSMutableArray *)arrayList :(NSString *)strMyNumber;
- (BOOL)getConversation:(NSMutableArray *)arrayList :(NSString *)strNumber;
- (BOOL)deleteConversationFromNumber:(NSString *)strNumber;
- (BOOL)markConversationAsRead:(NSString *)strNumber;
- (BOOL)addTextMessage:(NSString *)fromPhone :(NSString *)message :(NSDate *)messageTime :(BOOL)bIsRead :(NSString *)remoteMessageId :(NSString *)tophone :(int)direction;

- (BOOL)getRecentCalls:(NSMutableArray *)arrayList bMissedOnly:(BOOL)bMissedOnly;
- (BOOL)addRecentCallItem:(RecentCallItem *)recentCallItem;
- (BOOL)clearAllRecentCalls;
- (int)getUnreadMessageCount;

@end
